import React from 'react';
import {View, Text, TouchableOpacity, Image} from 'react-native';
import BaseUrl from '../../config/BaseUrl';
import styles from './style';

const CouseList = (props) => {
  const {item, onPress} = props;
  return (
    <TouchableOpacity
      onPress={() => {
        onPress && onPress();
      }}
      style={styles.list_container}>
      <Image
        style={styles.list_img}
        source={{uri: BaseUrl.imgurl + item?.eqImage}}
      />
      <View style={styles.content_container}>
        <View>
          <View style={styles.name_container}>
            <Text style={styles.name_text}>{item?.eqTile}</Text>
          </View>
          <Text style={styles.desc} numberOfLines={4}>
            {item?.eqAnalysis}
          </Text>
        </View>
        <Text style={styles.pk}>已有{item?.eqScore}人参与</Text>
      </View>
    </TouchableOpacity>
  );
};

export default CouseList;
